<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <style>
    .wrapper {
      width: 50vw;
      height: 500px;
      border: 1px solid black;
      font-size: 0; /* 取消回车渲染占据的位置 */ 
    }
    .wrapper > div {
      display: inline-block;
      height: 100px;

    }
    .left {
      width: 200px;
      max-width: 80%; /* 设置最大宽度防止溢出容器外 */
      background-color: red;
    }
    .right {
      width: calc(100% - 200px);
      background-color: green;
      
    }
  </style>
</head>
<body>
  <div class="wrapper">
    <div class="left"></div>
    <div class="right"></div>
  </div>
</body>
</html>